<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <script type="text/javascript" src="/js/prototype.js"></script>
  <script type="text/javascript" src="/js/json.js"></script>
  <script type="text/javascript" src="/js/jsonrpc.js"></script>
  <title>Signup for a new account</title>
</head>
<body>

<div id="container"><p>......</p></div>

<script type="text/javascript">
  //<![CDATA[
  function log(result, error) {
    if(!error){
      $("container").update(JSON.stringify(result) + "\n");
    }else{
      $("container").update("ERROR <pre>"+JSON.stringify(result).replace(/(\\n)+/g, "<br/>") + "</pre>\n");
    }
  }
  function submit_form(args) {
    var testService = new JsonRpcTransaction("/json_rpc/account", "signup", [args]);
    testService.addCallback(log);
    testService.addErrorCallback(log);
    //testService.sendRequest();
  }
  //]]>
</script>

<h1>Signup for a new account.</h1>
<form action="" method="post" onsubmit="submit_form({username: $(username).value, password: $(password).value, firstname: $(firstname).value, surname: $(surname).value}); return false">
  Username : <input id="username" type="text" size="20" name="username"/><br/>
  Password : <input id="password" type="password" size="20" name="password"/><br/>
  Real Name : <input id="firstname" type="text" size="20" name="firstname"/><br/>
  Real Surname : <input id="surname" type="text" size="20" name="surname"/><br/>
  <input id="submit" type="submit" value="Submit"/>
</form>
</body>
</html>